{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--微信邀请统计{% endblock %}

{% block panel_heading %}
  万屏时代OPC--微信邀请统计
{% endblock %}

{% block panel_body %}
    <form id="search-demand-form" action="{{ url_for('op_bp.wechat_invite_stat') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.invite_user_id, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.only_ground, div_col=4, label_col=4, field_col=7) }}
        <div class="btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-demand-btn">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.wechat_invite_stat', **url_kwargs) }}
    </div>
    {% endif %}
    <table id="user-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>用户</th>
                <th>总邀请数</th>
                <th>仍关注用户数</th>
                <th>邀请绑定数</th>
            </tr>
        </thead>
        <tbody>
            {% for each in data %}
                <tr>
                    <td>{{ each.nickname }}</td>
                    <td>{{ each.total }}</td>
                    <td>{{ each.subscribe }}</td>
                    <td>{{ each.bind }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.wechat_invite_stat', **url_kwargs) }}
    </div>
    {% endif %}
{% endblock %}
